<?php
/**
 * @filesource /modules/user/Form/Register.php
 * @abstract Generate a register form, where no lable is set
 *     see /modules/user/views/register/register.phtml for how the form is generated.
 */
class user_Form_Avatar extends Zend_Form
{

    protected $_noDecorator = array(
        'ViewHelper', 
        'Errors'
    );

	public function cluBuild($userId)
	{
		 $this->setName('avatar_image')
		 	  ->setAttrib('enctype', 'multipart/form-data')
//		 	  ->setAction('/'.$sess->viewLang.'/user/account/avatar?id='.$userId)
		 	  ->setAction($this->getView()->hvnUrl(array('action' => 'avatar'),'account').'?id='.$userId)
		 	  ->setMethod('post');
		 // creating Form_Element_File
		$elementFile = new Zend_Form_Element_File('file_upload');
		$elementFile
					->addValidator('Count', false, 1)
					->addValidator('Size', false, 100*1024*1024*100)
					->addValidator('IsImage', true)//, 'jpg,png,gif,txt,doc')
				  	->setRequired(true);

		$this->addElement($elementFile);

		 // creating submit button
		$submit = new Zend_Form_Element_Submit('upload_button');
        $submit->setAttrib('id', 'upload_button')
        	   ->setLabel(t(431))
        	   ->addDecorators($this->_noDecorator);
        $this->addElement($submit);
    }
}

?>